import OpenAI from "openai";

const apiKey =
  "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";
process.env["OPENAI_BASE_URL"] = "https://openrouter.ai/api/v1";

process.env.OPENAI_API_KEY = apiKey;

const openai = new OpenAI({
  baseURL: "https://openrouter.ai",
  apiKey: apiKey,
  defaultHeaders: {
    "HTTP-Referer": "<YOUR_SITE_URL>", // Optional. Site URL for rankings on openrouter.ai.
    "X-Title": "<YOUR_SITE_NAME>", // Optional. Site title for rankings on openrouter.ai.
  },
});
async function main() {
  const completion = await openai.chat.completions.create({
    model: "qwen/qwq-32b:free",
    messages: [
      {
        role: "user",
        content: "你好",
      },
    ],
  });

  console.log(completion.choices[0].message);
}

main();
